<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<script>
			function Animal(name,age,color){
				this.name = name;
				this.age = age;
				this.color= color;
			}
			function Poultry(name,age,color,leg){
				Animal.call(this,name,age,color);
				this.leg = leg;
			}
			Poultry.prototype = new Animal();
			Poultry.prototype.show=function(){
				var cont = document.createElement("p");
				document.getElementsByTagName("body")[0].appendChild(cont);
				cont.innerHTML = this.name + this.color + this.leg + "现在"+this.age+"岁了";
			}
			var dog = new Poultry("小狗",1,"灰色的","4条腿");
			var cat = new Poultry("茶杯猫",2,"白的","4条腿");
			dog.show();
			cat.show();
		</script>
	</body>
</html>
